Skip to content

Conversation

@eejbyfeldt
Copy link
Contributor

@eejbyfeldt eejbyfeldt commented Mar 29, 2022

What changes were proposed in this pull request?

Master and branch-3.3 will fail to derive schema for case classes with generic parameters if the parameter was not used directly as a field, but instead pass on as a generic parameter to another type. e.g.

case class NestedGeneric[T](
  generic: GenericData[T])

This is a regression from the latest release of 3.2.1 where this works as expected.

Why are the changes needed?

Support more general case classes that user might have.

Does this PR introduce any user-facing change?

Better support for generic case classes.

How was this patch tested?

New specs in ScalaReflectionSuite and ExpressionEncoderSuite. All the new test cases that does not use value classes pass if added to the 3.2 branch

@eejbyfeldt eejbyfeldt changed the title [SPARK-38681][SQL]: Support nested generic case classes [SPARK-38681][SQL] Support nested generic case classes Mar 29, 2022
@github-actions github-actions bot added the SQL label Mar 29, 2022
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@eejbyfeldt eejbyfeldt force-pushed the SPARK-38681-nested-generic branch from a74f6d6 to 4b418ec Compare May 19, 2022 09:39
@eejbyfeldt
Copy link
Contributor Author

While testing the spark 3.3.0 release candidate I noticed that this is actually a regression from 3.2 that was introduced in #33205 so I this should also be fixed in the 3.3 branch.

@dongjoon-hyun
Copy link
Member

Thank you, @eejbyfeldt .

cc @srowen

@srowen srowen closed this in 49c6802 May 20, 2022
@srowen
Copy link
Member

srowen commented May 20, 2022

Merged to master/3.3

srowen pushed a commit that referenced this pull request May 20, 2022
### What changes were proposed in this pull request?

Master and branch-3.3 will fail to derive schema for case classes with generic parameters if the parameter was not used directly as a field, but instead pass on as a generic parameter to another type. e.g.
```
case class NestedGeneric[T](
  generic: GenericData[T])
```

This is a regression from the latest release of 3.2.1 where this works as expected.

### Why are the changes needed?
Support more general case classes that user might have.

### Does this PR introduce _any_ user-facing change?
Better support for generic case classes.

### How was this patch tested?
New specs in ScalaReflectionSuite and ExpressionEncoderSuite. All the new test cases that does not use value classes pass if added to the 3.2 branch

Closes #36004 from eejbyfeldt/SPARK-38681-nested-generic.

Authored-by: Emil Ejbyfeldt <[email protected]>
Signed-off-by: Sean Owen <[email protected]>
(cherry picked from commit 49c6802)
Signed-off-by: Sean Owen <[email protected]>
@dongjoon-hyun
Copy link
Member

Thank you, @eejbyfeldt , @cloud-fan , @srowen !

cc @MaxGekk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants